<?php
namespace Home\Model;
use Think\Model;
class UsersModel extends Model {
 protected $_validate = array(
        array('telephone', 'require', '手机号必须！', 1),
		
		array('email', 'require', '邮箱必须！', 1),
        array('telephone', '', '手机号已经存在', 0, 'unique', self::MODEL_INSERT),
     
	array('password', 'require', '密码必须！', 1),
	array('newpassword','password','两次密码不一致',0,'confirm'),
            );

 protected $_auto = array(
	 array('createtime','getdate',self::MODEL_INSERT, 'callback'),
	array('password','md5', self::MODEL_INSERT, 'function'),
		);

	function getdate(){
		return date('Y-m-d');
	}

}
